<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>1111</li>
        <li>1111</li>
        <li>1111</li>
        <li>1111</li>
    </ul>
    <script>
        console.log('start');
        for(var i = 0; i < 5; i++){// 0 -- 4
            setTimeout(()=>{
                console.log(i);
            },2000);
        }
        console.log('end',i);

        // start--> end 5 -->  2秒后 --> 5个5

        // for(var j = 0; j < oLis.length; j++){
        //     oLis[j].onclick = function(){
        //         console.log(j);
        //     }
        // }

    </script>
</body>
</html>